package com.sky.service.impl;

import com.sky.constant.StatusConstant;
import com.sky.service.ShopService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

/**
 * 2025/5/8 16:37
 */
@Service
public class ShopServiceImpl implements ShopService {

    @Autowired
    private StringRedisTemplate redisTemplate;

    @Override
    public Integer getStatus() {
        String data = redisTemplate.opsForValue().get(StatusConstant.SHOP_STATUS);
        return Integer.valueOf(data);
    }

    @Override
    public void changeStatus(Integer status) {
        redisTemplate.opsForValue().set(StatusConstant.SHOP_STATUS, String.valueOf(status));
    }
}
